package com.semicolon_dtn_student;

import android.app.AlarmManager;
import android.content.Context;

public class ScheduleInfo {
	private int id;
	private int alarmId_1, alarmId_2;
	private String title;
	private String location;
	private int mYear;
	private int mMonth;
	private int mDay;
	private int mHour1;
	private int mHour2;
	private int mMinute1;
	private int mMinute2;
	private String memo;
	private int result;
	private String result_string;
	
	public ScheduleInfo(String title, String location, int mYear, int mMonth, int mDay,
			int mHour1, int mMinute1, int mHour2, int mMinute2, String memo, int result)
	{
		this.title = title;
		this.location = location;
		this.mYear = mYear;
		this.mMonth = mMonth;
		this.mDay = mDay;
		this.mHour1 = mHour1;
		this.mMinute1 = mMinute1;
		this.mHour2 = mHour2;
		this.mMinute2 = mMinute2;
		this.memo = memo;
		this.result = result;
		updateResultStr();
	}
	
	public void setId(int id)
	{
		this.id = id;
		this.alarmId_1 = (id*2) - 1;
		this.alarmId_2 = this.alarmId_1 + 1;
	}
	
	public void addResult()
	{
		this.result++;
		updateResultStr();
	}
	
	public void setFail()
	{
		this.result = ConstantVal.RESULT_FAIL;
		updateResultStr();
	}
	
	public void updateResultStr()
	{
		switch(this.result)
		{
			case ConstantVal.RESULT_DEFAULT:
				this.result_string = "-";
				break;
			case ConstantVal.RESULT_FAIL:
				this.result_string = "X";
				break;
			case ConstantVal.RESULT_SEMI_SUCCESS:
				this.result_string = "#";
				break;
			case ConstantVal.RESULT_SUCCESS:
				this.result_string = "O";
				break;
		}
	}
	
	public int getId()
	{
		return this.id;
	}
	
	public int getAlarmId1()
	{
		return this.alarmId_1;
	}

	public int getAlarmId2()
	{
		return this.alarmId_2;
	}
	
	public String getTitle()
	{
		return this.title;
	}
	
	public String getLocation()
	{
		return this.location;
	}
	
	public int getYear()
	{
		return this.mYear;
	}
	
	public int getMonth()
	{
		return this.mMonth;
	}
	
	public int getDay()
	{
		return this.mDay;
	}
	
	public int getHour1()
	{
		return this.mHour1;
	}
	
	public int getHour2()
	{
		return this.mHour2;
	}
	
	public int getMinute1()
	{
		return this.mMinute1;
	}
	
	public int getMinute2()
	{
		return this.mMinute2;
	}
	
	public String getMemo()
	{
		return this.memo;
	}
	
	public int getResult()
	{
		return this.result;
	}
	
	public String getResultString()
	{
		return this.result_string;
	}
}
